<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Prosentase_charge_model extends CI_Model{
	function __construct() {
		parent::__construct();
	}
	
	function get_all(){
		return $this->db->get('TblProsentaseCharge')->result_array();
	}
        
        function get_one($id){
		$query = $this->db->get_where('TblProsentaseCharge',array('id'=>$id));
		if($query->num_rows()>0){
			return $query->row_array();
		}else{
			return FALSE;
		}
	}
        function get_one_by_jurusan($asal,$tujuan){
		$query = $this->db->get_where('TblProsentaseCharge',array('asal'=>$asal,'tujuan'=>$tujuan));
		if($query->num_rows()>0){
			return $query->row_array();
		}else{
			return FALSE;
		}
	}
        
	
	function insert_new($data){
		$this->db->insert('TblProsentaseCharge',$data);
	}
	
	function update_old($id,$data){
		$this->db->where('id',$id);
		$this->db->update('TblProsentaseCharge',$data);
	}
	
	function delete_old($id){
		$this->db->delete('TblProsentaseCharge', array('id' => $id)); 
	}
        
}

/** End of file */